import { action, observable } from "mobx";
import axios from "axios";
class getData {
  @observable dateList = [];
  @observable airList = [];
  constructor(RootStore) {
    this.RootStore = RootStore
    this.solus = {
      selectDate: "06-21",
      type: 1,
      sort: "asc",
    };
  }
  @action.bound async getDateList() {
    const res = await axios({
      url: "/dateList",
    });
    this.setDateList(res.data.data)
    console.log(this.dateList);
  }
  @action.bound async changeAirList(solus = this.solus) {
    const res = await axios({
      url: "/airPlaneList",
      method: "post",
      data: solus,
    });
    console.log(res);
  }
  @action.bound setDateList(data){
    this.dateList = data
  }
}
export default getData;
